package com.dly.hope.workflow;

import com.dly.hope.modle.BaseEntity;
import com.dly.hope.workflow.type.FlagEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/** 
* @Name: NodeInfo
* @Description:  节点定义信息
* @Author: Danny Chen
* @Date: 2022/1/18 
*/ 
@Entity
@Table(name = "wfl002_node_info")
@Data
@DynamicInsert
@DynamicUpdate
public class NodeInfo extends BaseEntity {

    @Id
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuid")
    @Column(name = "id", nullable = false)
    private String id;

    @Column(name = "name")
    private String name; //节点名称

    @Column(name = "process_id")
    private String processId; //流程定义ID

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "process_id", updatable = false, insertable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private ProcessInfo processInfo;//流程定义对象

    @Column(name = "end_node_flag")
    private Integer endNodeFlag = FlagEnum.NO.getCode(); //是否是结束节点，1：是；2：否

    @Column(name = "display_flag")
    private Integer displayFlag = FlagEnum.YES.getCode(); //节点是否展示到审批履历中，1：是；2：否

    @Column(name = "seq_no")
    private Integer seqNo; //节点序号

    @Column(name = "remark")
    private String remark; //备注

}
